﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreLib.Communication.Sockets;
using CoreLib.Communication.Packets;
using CoreLib.MySQL;

namespace AuthServer
{
    class Program
    {
        public static DbProvider DbProvider;
        private static SocketServer serverSocket;
        static void Main(string[] args)
        {
            DbProvider = new CoreLib.MySQL.DbProvider()
            {
                UserId ="root",
                ConnectionProtocol = ConnectionProtocol.Tcp,
                Database = "zero_db",
                Pooling = true,
                MaxPoolCount = 100,
                Password = "PASSWORD"
            };
            Cryptography.AuthCryptography.PrepareAuthCryptography();
            serverSocket = new SocketServer(9958);
            serverSocket.Connected = Socket_Connected;
            serverSocket.Received = Socket_Received;
            serverSocket.Disconnected = Socket_Disconnected;
            serverSocket.BeginListen(100);
            
            //para que no se cierre la consola inmediatamente
            while (true)
            {
                Console.ReadLine();
            }
        }

        private static void Socket_Connected(SocketClient csocket)
        {
        }

        private static void Socket_Received(SocketClient csocket, Packet stream)
        {
        }

        private static void Socket_Disconnected(SocketClient csocket)
        {
        }
    }
}
